<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePostsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('posts', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title', 50);
            $table->string('keywords', 50)->nullable();
            $table->string('description', 300)->nullable();
            $table->string('thumb', 255)->nullable();
            $table->text('body');
            $table->string('editor_type', 30)->default('RICH_TEXT_EDITOR');
            $table->string('editor', 10)->default('管理员');
            $table->integer('user_id');
            $table->integer('category_id');
            $table->integer('order')->default(100);
            $table->integer('pv')->default(0);
            $table->string('from', 100)->nullable();
            $table->string('is_published', 10)->default('F'); //T发布，F未发布
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('posts');
    }
}
